#ifndef _COMMON_H_
#define _COMMON_H_

#include <mutex>
#include <memory>
#include <string>
#include <opencv2/opencv.hpp> 
#include "data.h"

// 全局变量，视频流在内存中的地址
extern char* DATA_SOURCE;
extern char* DATA_TARGET;

namespace sp{
    // declear
    class Data;

    // version
    static const std::string VERSION = "0.0.1";

    // parameters
    static const int MAX_PARALLEL = 10;

    // debug
    static const bool DEBUG = false;
    static const bool RECORD = true;
    static const bool PROFILE = true;

    // function
    static uint8_t NORMAL = 0x00;
    static uint8_t GATHER = 0x01;
    static uint8_t SCATTER = 0x02;

    // data
    static uint8_t UNKNOW = 0x00;
    static uint8_t HEAD = 0x01;
    static uint8_t MAT = 0x02;
    static uint8_t RECT = 0x03;
    static uint8_t TENSOR = 0x04;
    static uint8_t STRING = 0x05;
    static uint8_t BATCH_TENSOR = 0x06;
    static uint8_t GPU_TENSOR = 0x07;
    static uint8_t BATCH_GPU_TENSOR = 0x08;
    static uint8_t EMPTY = 0x09;

    // smartpipe
    static Data* DATA_END = nullptr;

    // print
    static std::mutex GLOBAL_LOCK;
};

#endif